package bit.book.enums;


public enum BookStatus {
    DELETE(0,"无效"),
    NOMAL(1,"可借阅"),
    FORBIDDEN(2,"不可借阅");

    private int code;
    private String desc;

    BookStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getBookStatusByCode(int code) {
        switch(code){
            case 0:return DELETE.getDesc();
            case 1:return NOMAL.getDesc();
            case 2:return FORBIDDEN.getDesc();
        }
        return null;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
